using System;
using System.Collections.Generic;
using System.Text;

namespace Hoshimi._Behaviour_._Group_.MasterCollectorGroup
{
    public class MasterCollectorGroupSMFactory : AbstractSMFactory
    {
        #region Singleton

        // Fields
        protected static MasterCollectorGroupSMFactory instance;

        // Constructor
        protected MasterCollectorGroupSMFactory() : base() { }

        // Methods
        public static MasterCollectorGroupSMFactory Instance()
        {
            // Uses "Lazy initialization"
            if (instance == null)
                instance = new MasterCollectorGroupSMFactory();

            return instance;
        }

        #endregion

        /// <summary>
        /// Create a group state machine
        /// </summary>
        /// <param name="unit"></param>
        /// <returns></returns>
        public override StateMachine CreateStateMachine(Unit unit)
        {
            StateMachine stateMachine = new StateMachine(unit);

            stateMachine.ChangeState(MasterCollectorGroup_ManageState.Instance());

            return stateMachine;
        }
    }
}
